#include <cv.h>
#include <highgui.h>
#include "ARDroneFaceTracker.h"
#include "FrameGrabber.h"
#include "WebcamFrameGrabber.h"
#include "SingleImageFrameGrabber.h"
#include "Face.h"
#include "FaceDetector.h"

using namespace cv;

int main(int argc, char** argv) {
	SingleImageFrameGrabber frameGrabber(
			"/home/clivemyrie/workspace/ARDroneFaceTracker/test_data/clive.jpg");
	//WebcamFrameGrabber frameGrabber;
	FaceDetector faceDetector;
	IplImage* img;

	//img = frameGrabber.grabFrame();
	cvWaitKey(3000);
	faceDetector.run(frameGrabber);
	img = faceDetector.theFaceImage;

	//TODO: Remove these cout's
	std::cout << "main: after grabFrame returns..." << std::endl;
	std::cout << "img->height: " << img->height << std::endl;
	std::cout << "img->width: " << img->width << std::endl;
	std::cout << "img->nChannels: " << img->nChannels << std::endl;
	std::cout << "img->tileInfo: " << img->tileInfo << std::endl;

	cvShowImage("new_window", faceDetector.theFaceImage);

	cvWaitKey(3000);
	std::cout << "End..." << std::endl;
	return 0;
}
